package com.paul.sys.service.impl;

import com.paul.sys.mapper.PublishparkInfoMapper;
import com.paul.sys.model.PublishparkInfo;
import com.paul.sys.service.PublishParkService;
import com.paul.sys.tools.CommPageBean;
import com.paul.sys.tools.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by 羽 on 2015/12/29.
 */
@Service
public class PublishParkServiceImpl implements PublishParkService {


    @Autowired
    private PublishparkInfoMapper publishparkInfoMapper;

    @Override
    public PageData<PublishparkInfo> listByPage(Map<String, String> param) {
        PageData<PublishparkInfo> pageData = new PageData<PublishparkInfo>();
        CommPageBean pageBean = CommPageBean.getPageBeanByParam(param);
        List<PublishparkInfo> list = publishparkInfoMapper.listByPage(param, pageBean);
        pageData.setPageBean(pageBean);
        pageData.setListData(list);

        return pageData;
    }

    @Override
    public int insertSelective(PublishparkInfo publishparkInfo) {
        return publishparkInfoMapper.insertPublish(publishparkInfo);
    }

    @Override
    public List<PublishparkInfo> selectAuthority(Map<String, Object> param) {
        return publishparkInfoMapper.selectAuthority(param);
    }

    @Override
    public PublishparkInfo selectByPrimaryKey(String id) {
        return publishparkInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPublishMessage(PublishparkInfo publishparkInfo) {
        return publishparkInfoMapper.updateByPublishMessage(publishparkInfo);
    }

    @Override
    public int deleteByIds(String[] ids) {
        return publishparkInfoMapper.deleteByIds(ids);
    }

    @Override
    public PageData<PublishparkInfo> listAll(Map<String, String> param) {
        PageData<PublishparkInfo> pageData = new PageData<PublishparkInfo>();
        CommPageBean pageBean = CommPageBean.getPageBeanByParam(param);
        List<PublishparkInfo> list = publishparkInfoMapper.listAll(param, pageBean);
        pageData.setPageBean(pageBean);
        pageData.setListData(list);
        return pageData;
    }
}
